<?PHP
if( ! defined( 'OS_PATH' ) ) exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta name="Generator" content="EditPlus"/>
<title>500 ERROR</title>
<style>
html{background:#F8F8F8;}
*{font-family:Arial; font-size:14px; color: #444; margin:0; padding:0;}
a{	color: #0174A7;	font-weight: bold; text-shadow: 0 1px 0 #FFF; margin:0 10px 0 10px; }
#main{ width:70%; margin:80px 0 0 -35%; position:absolute; left:50%; }
#main div{margin:12px 0;}
#main .title{color:#CC0F16; font-weight:normal; font-size:28px; font-weight:bold; margin:0 0 20px;}
#main .err_str{margin:0 5px 0 10px; color:#CC0F16;}
#main .err_time{margin:0 5px 0 10px; }
#main .err_file{margin:0 5px 0 10px;}
#main .err_line{margin-left:5px; color:#CC0F16;}
#main .err_method{margin:0 5px 0 10px; color:#0174A7;}
#main .err_detail{border:1px solid #CCC; padding:5px; background:#FFF;}
#main .debug{border:1px solid #CCC; padding:5px; background:#FFF;}
#main .debug div{margin:5px 0;}
#main .debug .include{height:70px; overflow-y:auto; padding:5px; border:1px solid #EFEFEF;}
#main .debug .include div{line-height:15px; height:15px; margin:0;}
#main .os{margin:15px 0; font-family:Arial; font-size:10px; color:#999;}
#main .os *{font-family:Arial; font-size:10px; color:#999;}
#main .os address{display:inline;}
#main .os .info{margin-left:25px; font-size:10px;}
#main .os .info sup{font-size:8px;}

</style>
</head>
<body>
<div id="main">
	<div class="title">500 内部服务器错误 - 服务器发生异常</div>
	<div><b>错误信息</b> <span class="err_str">HTTP Error 500 Internal server error</span></div>
	<div><b>错误地址</b><a href="<?=Cache :: get( 'HTTP.SELF' )?>"><?=Cache :: get( 'HTTP.SELF' )?></a></div>
	<div><b>异常代码</b><span class="err_str">
	<?PHP
	function get_char( & $str ) {
		$str = $str{ 0 };
	}
	if( isset( $e[ 'message' ] ) ) {
		$error = $e[ 'message' ];
	}
	$error = explode( ' ', $error );
	array_walk( $error, 'get_char' );
	$error = implode( '', $error );
	$error = substr( $error, 0, strpos( $error, ':' ) );
	if( $e[ 'class' ] ) {
		$error = $e[ 'class' ]{ 0 } . ':' . $error;
	}
	if( $e[ 'file' ] ) {
		$f = basename( $e[ 'file' ] );
		$error .= ':' . $f{ 0 };
	}
	$error .= isset( $e[ 'line' ] ) ? ' ( 0xE' . $e[ 'line' ] . date( 'Hi' ) . ' )' : '';
	if( Cache :: type( 'SERVER.ERROR', 'array' ) ) {
		$error .= ' E( 0xE.' . count( Cache :: get( 'SERVER.ERROR' ) ) . ' )';
	}
	echo $error;
	?>
	</span></div>
	<div><b>当前时间</b><span class="err_time"><?=date( 'Y/m/d H:i:s' )?></span></div>
	<div>报告错误 <a href="email:<?=Cache :: get( '@.MAIN.ADMIN_EMAIL' )?>"><?=Cache :: get( '@.MAIN.ADMIN_EMAIL' )?></a></div>

	<div class="os"><address><?=$_SERVER[ 'SERVER_SOFTWARE' ]?></address><span class="info"><b>O</b>pen<b>S</b>tation<sup><?=OS_VER?></sup></span></div>
</div>
</body>
</html>
<?PHP
if( ! headers_sent() ) {
    header( 'HTTP/1.1 500 Internal Server Error' );
}
exit;
?>